package com.fingard.dsp.bank.reqrespobj.batrecrefund;

import com.fingard.dsp.bank.reqrespobj.ReqRespHeader;
import com.fingard.dsp.bank.reqrespobj.RequestBase;
import com.fingard.dsp.bank.reqrespobj.batrecrefund.detail.ReqRecRefundDetail;
import com.fingard.xml.XmlTextReader;

public class ReqBatRecRefund extends RequestBase {
	/** 批次号 */
	public String reqBatchNO;
	
	/** 总笔数 */
	public String totalNum;

	/** 实际退保总金额 */
	public String totalAmt;

	/** 退保申请总金额 */
	public String totalApplyAmt;
	
	/** 手续费总金额 */
	public String totalFee;

	/** 付款方账号 */
	public String payAct;

	private XmlTextReader xmlReader;
	
	public ReqRecRefundDetail readedDetail;

	public ReqBatRecRefund(XmlTextReader p_xmlReader, ReqRespHeader p_header) throws Exception {
		init(p_xmlReader, p_header);
	}

	private void init(XmlTextReader p_xmlReader, ReqRespHeader p_header) throws Exception {
		reqHeader = p_header;
		xmlReader = p_xmlReader;
		totalNum = xmlReader.getSimpleText("TotalNum");
		totalAmt = xmlReader.getSimpleText("TotalAmt");
		totalApplyAmt = xmlReader.getSimpleText("TotalApplyAmt");
		totalFee = xmlReader.getSimpleText("TotalFee");
		reqBatchNO = xmlReader.getSimpleText("ReqSeqID");
		payAct = xmlReader.getSimpleText("PayAct");
	}

	public boolean readRecord() throws Exception {
		readedDetail = null;
		if (xmlReader.read(PATH_Detail)) {
			readedDetail = new ReqRecRefundDetail(xmlReader.readedXElement);
			return true;
		} else {
			return false;
		}
	}
}
